scapval

Provides information about whether an SCAP data stream bundle (.zip file) conforms to conventions and recommendations outlined in NIST Special Publication 800-126, The Technical Specification for the Security Content Automation Protocol (SCAP): SCAP Version 1.0 . Validates the data stream according to one of the use cases for an SCAP-validated tool listed in Section 5 of the 800-126, namely Configuration Verification, Vulnerability Assessment, Path Validation, or Inventory Collection. Checks component XCCDF and OVAL data streams (.xml files) against appropriate schemas. Uses Schematron to perform additional checks within and across component data streams. scapval produces validation results that conveys all error and warning conditions detected; results are output in both XML and HTML formats. For a listing of the SCAP requirements, refer to the SCAP Version 1.0 Requirements Matrix and SCAP Version 1.1 Requirements Matrix included with the tool.

Release Information

Version 1.1.2.9 Released 2011-04-28

Top of page

Syntax

scapval (-file | -dir) source_file_or_directory -usecase use_case -scapversion scap_version [-result file_to_output_results_of_validation] [(-resultfile | -resultdir) scap_result_zip_or_directory] [-profile profile] [-maxsize integer] [-online] [(-debug | -quiet)] [-datastream file_to_output_scap_datastream] [-xslreport xsl_to_transform_validation_output] [-version] [-batch]

Top of page

Parameters

(-file | -dir) source_file_or_directory
Required. -file specifies the SCAP data stream (.zip or .xml) input file that is being validated. -dir specifies a directory where the files that would be included in a .zip SCAP data stream are located at the root of the directory.

-usecase use_case
Required. Specifies an SCAP 1.0 or 1.1 use case. Valid -use_case values for SCAP 1.0 are:
  • CONFIGURATION
  • VULNERABILITY_XCCDF_OVAL
  • VULNERABILITY_OVAL
  • SYSTEM_INVENTORY
Valid -use_case values for SCAP 1.1 are:
  • CONFIGURATION
  • VULNERABILITY_XCCDF_OVAL
  • VULNERABILITY_OVAL
  • SYSTEM_INVENTORY
  • PATCH
-scapversion scap_version
Required. Specifies the version of SCAP corresponding with the source content. Acceptable values are "1.0" and "1.1".

-result file_to_output_results_of_validation
An optional output filename. scapval will write a validation result (.xml) file with this name. The result contains a detailed listing of the issues discovered. Each message in this file refers to a file in the SCAP bundle with an XPATH expression where the error was found. If -result is not used, then the filename is scap-validation-result.xml. A human-readable (.html) file is also produced.

(-resultfile | -resultdir) scap_result_zip_or_directory
This must be provided if SCAP results are to be validated. -resultfile must point to a .zip that contains the result SCAP files that correspond to the SCAP source content, or -resultdir must point to a directory that contains the result SCAP files that correspond to the SCAP source content. Both the source and result content will be validated if this option is specified.

-profile profile
Specify only when -resultfile or -resultdir is indicated. The value of -profile should be the XCCDF profile selected in the source content to generate the result content. Do not specify -profile if no profile was selected.

-maxsize integer
Optional. Specifies the maximum file size (in MB) the tool will download as an external reference from an XCCDF check. The default is 3 MB.

-online
Permits scapval to connect through the Internet to download files which are referenced within the SCAP bundle, but were not provided in the bundle. A typical example would be the OVAL patch definitions which have both a remote and a local reference. -online also permits scapval to download the latest CCE and CPE dictionaries. By default, scapval will not connect to the Internet.

(-debug | -quiet)
-debug displays verbose messages about the validation process in the console. -quiet Hides all console messages. If this option is specified, scapval still produces the validation result files.

-datastream file_to_output_scap_datastream
An optional output filename. scapval will create a consolidated SCAP (.xml) file with this name from the component files in the SCAP bundle. This may be useful for troubleshooting scapval, although it is not required. If this option is omitted, then scapval uses a temporary file.

-version
Displays the version of scapval.

-batch
Including this flag allows scapval to process multiple sets of SCAP content. When -batch is indicated, result content may not be specified. In addition, -file or -dir must point to a .zip or directory, respectively. That ZIP file or directory must be comprised of .zip SCAP content, .xml SCAP content, or directories with SCAP component files at the root level of the directory. For example, this could be the content of the ZIP or directory.
  • scap_source_content_components_dir
    • example-xccdf.xml
    • example-oval.xml
    • example-patches.xml
    • example-cpe-dictionary.xml
    • example-cpe-oval.xml
  • scap_source_content_data_stream.xml
  • scap_source_content.zip
Top of page

Remarks

Top of page

Examples

Happy Path

To validate the FDCC Microsoft IE7 bundle for the SCAP 1.0 Configuration use case:

C:\scapval>scapval.bat -dir C:\FDCC-Major-Version-1.2.1.0\ie7 -online -usecase CONFIGURATION -scapversion 1.0
"C:\Sun\SDK\jdk\bin\java.exe" -jar scapval-1.1.2.jar -dir C:\FDCC-Major-Version-1.2.1.0\ie7 -online -usecase CONFIGURATION -scapversion 1.0
INFO : SCAP 1.1 Validation - Tool Version 1.1.2
INFO : Preparing to validate SCAP content C:\FDCC-Major-Version-1.2.1.0\ie7\_tempZipFile1281128243943_.zip...
INFO : APPLICATION - SCAP version 1.0 use case is CONFIGURATION.
INFO : APPLICATION - File is less than 12 hours old, skipping download for .\data_feeds\nvdcce-0.1-feed.xml.
INFO : APPLICATION - File is less than 12 hours old, skipping download for .\data_feeds\official-cpe-dictionary_v2.2.xml.
INFO : APPLICATION - Searching for XCCDF for references.
INFO : APPLICATION - Reading contents of SCAP ZIP file.
INFO : APPLICATION - Verifying that the files required for this use case are present.
INFO : APPLICATION - Hashing inputs.
INFO : APPLICATION - Validating component files against schemas.
INFO : APPLICATION - Preparing to apply OVAL schematron rules.
INFO : APPLICATION - Merging component files into combined SCAP file _tempZipFile1281128243943_.xml.
INFO : APPLICATION - Validating SCAP bundle against XML schema.
INFO : APPLICATION - Applying SCAP schematron rules to content.
WARN : SCHEMATRON - [fdcc-ie7-xccdf.xml] For all XCCDF rules used for Configuration Verification that do not have CCE identifiers expressed using the  element shall be considered to be a warning. If no CCE exists for rule, suggest CCE be requested from MITRE.
WARN : SCHEMATRON - [fdcc-ie7-xccdf.xml] For all XCCDF documents, if a value other than "en-US" is specified, a warning will be generated because not all SCAP-compliant tools can necessarily process information in other languages/encodings. Clearer guidance on this issue is expected in 800-126 v1.1.
WARN : SCHEMATRON - [fdcc-ie7-xccdf.xml] For all XCCDF documents, if a value other than "en-US" is specified, a warning will be generated because not all SCAP-compliant tools can necessarily process information in other languages/encodings. Clearer guidance on this issue is expected in 800-126 v1.1.
WARN : SCHEMATRON - [fdcc-ie7-xccdf.xml] For all XCCDF documents, if a value other than "en-US" is specified, a warning will be generated because not all SCAP-compliant tools can necessarily process information in other languages/encodings. Clearer guidance on this issue is expected in 800-126 v1.1.
WARN : SCHEMATRON - [fdcc-ie7-xccdf.xml] For all XCCDF documents, if a value other than "en-US" is specified, a warning will be generated because not all SCAP-compliant tools can necessarily process information in other languages/encodings. Clearer guidance on this issue is expected in 800-126 v1.1.
WARN : SCHEMATRON - [fdcc-ie7-xccdf.xml] For all a)XCCDF documents that do not contain the  element, flag as a warning; and b) XCCDF documents that do contain the  element and whose contents are not consistent with the Dublin Core terms flag as a warning.
WARN : SCHEMATRON - [fdcc-ie7-oval.xml] CCE number is expected, but missing as a reference
INFO : APPLICATION - Finished SCAP content validation in 00:00:43.140.
INFO : See results in scap-validation-result.xml.

Since the -online flag was given, scapval downloads the latest CCE and CPE dictionaries. The OVAL patch referenced in the data stream is also downloaded.

Since a directory was specified, a temporary ZIP of the SCAP content was created.

Schematron warnings are given. The validation results are written to scap-validation-result.xml and scap-validation-result.html.

OVAL Schematron Failure

In the sample validation log output below, the OVAL Schematron check failed.

C:\scapval>scapval.bat -file C:\FDCC-Major-Version-1.2.1.0\ie7\ie7.zip -online -usecase CONFIGURATION -scapversion 1.0
"C:\Sun\SDK\jdk\bin\java.exe" -jar scapval-1.1.2.jar -file C:\FDCC-Major-Version-1.2.1.0\ie7\ie7.zip -online -usecase CONFIGURATION -scapversion 1.0
INFO : SCAP 1.1 Validation - Tool Version 1.1.2
INFO : Preparing to validate SCAP content C:\temp\FDCC-Major-Version-1.2.1.0\ie7\ie7.zip...
INFO : APPLICATION - SCAP version 1.0 use case is CONFIGURATION.
INFO : APPLICATION - File is less than 12 hours old, skipping download for .\data_feeds\nvdcce-0.1-feed.xml.
INFO : APPLICATION - File is less than 12 hours old, skipping download for .\data_feeds\official-cpe-dictionary_v2.2.xml.
INFO : APPLICATION - Searching for XCCDF for references.
INFO : APPLICATION - Reading contents of SCAP ZIP file.
INFO : APPLICATION - Verifying that the files required for this use case are present.
INFO : APPLICATION - Hashing inputs.
INFO : APPLICATION - Validating component files against schemas.
INFO : APPLICATION - Preparing to apply OVAL schematron rules.
ERROR: SCHEMATRON - [fdcc-ie7-oval.xml] Content failed validation against MITRE OVAL schematron validation.  The specific error is: oval:gov.nist.fdcc.ie7:ste:115 - the supplied operation attribute for the value entity of a registry_state is not valid given a datatype of 'string'
INFO : APPLICATION - Merging component files into combined SCAP file ie7.xml.
INFO : APPLICATION - Validating SCAP bundle against XML schema.
INFO : APPLICATION - Applying SCAP schematron rules to content.
WARN : SCHEMATRON - [fdcc-ie7-xccdf.xml] For all XCCDF rules used for Configuration Verification that do not have CCE identifiers expressed using the  element shall be considered to be a warning. If no CCE exists for rule, suggest CCE be requested from MITRE.
WARN : SCHEMATRON - [fdcc-ie7-xccdf.xml] For all XCCDF documents, if a value other than "en-US" is specified, a warning will be generated because not all SCAP-compliant tools can necessarily process information in other languages/encodings. Clearer guidance on this issue is expected in 800-126 v1.1.
WARN : SCHEMATRON - [fdcc-ie7-xccdf.xml] For all XCCDF documents, if a value other than "en-US" is specified, a warning will be generated because not all SCAP-compliant tools can necessarily process information in other languages/encodings. Clearer guidance on this issue is expected in 800-126 v1.1.
WARN : SCHEMATRON - [fdcc-ie7-xccdf.xml] For all XCCDF documents, if a value other than "en-US" is specified, a warning will be generated because not all SCAP-compliant tools can necessarily process information in other languages/encodings. Clearer guidance on this issue is expected in 800-126 v1.1.
WARN : SCHEMATRON - [fdcc-ie7-xccdf.xml] For all XCCDF documents, if a value other than "en-US" is specified, a warning will be generated because not all SCAP-compliant tools can necessarily process information in other languages/encodings. Clearer guidance on this issue is expected in 800-126 v1.1.
WARN : SCHEMATRON - [fdcc-ie7-xccdf.xml] For all a)XCCDF documents that do not contain the  element, flag as a warning; and b) XCCDF documents that do contain the  element and whose contents are not consistent with the Dublin Core terms flag as a warning.
WARN : SCHEMATRON - [fdcc-ie7-oval.xml] CCE number is expected, but missing as a reference
INFO : APPLICATION - Finished SCAP content validation in 00:00:43.140.
INFO : See results in scap-validation-result.xml.
      

Note the errors indicated. OVAL Schematron errors give the object identifier, and a description of the error. The file name is given before the error message.

Missing File

In the sample validation log output below, the ZIP file is missing a required file that is referenced by the XCCDF.

C:\scapval>scapval.bat -file C:\FDCC-Major-Version-1.2.1.0\ie7\ie7.zip -online -usecase CONFIGURATION -scapversion 1.0
"C:\Sun\SDK\jdk\bin\java.exe" -jar scapval-1.1.2.jar -file C:\FDCC-Major-Version-1.2.1.0\ie7\ie7.zip -online -usecase CONFIGURATION -scapversion 1.0
INFO : SCAP 1.1 Validation - Tool Version 1.1.2
INFO : Preparing to validate SCAP content C:\FDCC-Major-Version-1.2.1.0\ie7\ie7.zip...
INFO : APPLICATION - SCAP version 1.0 use case is CONFIGURATION.
INFO : APPLICATION - File is less than 12 hours old, skipping download for .\data_feeds\nvdcce-0.1-feed.xml.
INFO : APPLICATION - File is less than 12 hours old, skipping download for .\data_feeds\official-cpe-dictionary_v2.2.xml.
INFO : APPLICATION - Searching for XCCDF for references.
INFO : APPLICATION - Reading contents of SCAP ZIP file.
INFO : APPLICATION - Verifying that the files required for this use case are present.
INFO : APPLICATION - Hashing inputs.
ERROR: APPLICATION - [fdcc-ie7-oval.xml] Remote reference in XCCDF document could not be located.
ERROR: APPLICATION - [fdcc-ie7-oval.xml] Remote reference in XCCDF document could not be located.
INFO : APPLICATION - Preparing to apply OVAL schematron rules.
ERROR: APPLICATION - [fdcc-ie7-oval.xml] Remote reference in XCCDF document could not be located.
INFO : APPLICATION - Finished SCAP content validation in 00:00:10.625.
INFO : See results in scap-validation-result.xml.
	  

The errors noted above are due to the XCCDF referencing an OVAL file that cannot be resolved.

Schema Validation Error

In the sample validation log output below, the XCCDF file fails schema validation.

C:\scapval>scapval.bat -file C:\FDCC-Major-Version-1.2.1.0\ie7\ie7.zip -online -usecase CONFIGURATION -scapversion 1.0
"C:\Sun\SDK\jdk\bin\java.exe" -jar scapval-1.1.2.jar -file C:\FDCC-Major-Version-1.2.1.0\ie7\ie7.zip -online -usecase CONFIGURATION -scapversion 1.0
INFO : SCAP 1.1 Validation - Tool Version 1.1.2
INFO : Preparing to validate SCAP content C:\FDCC-Major-Version-1.2.1.0\ie7\ie7.zip...
INFO : APPLICATION - SCAP version 1.0 use case is CONFIGURATION.
INFO : APPLICATION - File is less than 12 hours old, skipping download for .\data_feeds\nvdcce-0.1-feed.xml.
INFO : APPLICATION - File is less than 12 hours old, skipping download for .\data_feeds\official-cpe-dictionary_v2.2.xml.
INFO : APPLICATION - Searching for XCCDF for references.
INFO : APPLICATION - Reading contents of SCAP ZIP file.
INFO : APPLICATION - Verifying that the files required for this use case are present.
INFO : APPLICATION - Hashing inputs.
INFO : APPLICATION - Validating component files against schemas.
INFO : APPLICATION - Preparing to apply OVAL schematron rules.
ERROR: SCHEMATRON - [fdcc-ie7-oval.xml] Content failed validation against MITRE OVAL schematron validation.  The specific error is: oval:gov.nist.fdcc.ie7:ste:115 - the supplied operation attribute for the value entity of a registry_state is not valid given a datatype of 'string'
INFO : APPLICATION - Merging component files into combined SCAP file ie7.xml.
INFO : APPLICATION - Validating SCAP bundle against XML schema.
ERROR: SCHEMA - [ie7.xml5276323935903360506.xml] Combined SCAP data stream failed schema validation.: cvc-complex-type.2.4.a: Invalid content was found starting with element 'platforms'. One of '{"http://checklists.nist.gov/xccdf/1.1":reference, "http://checklists.nist.gov/xccdf/1.1":plain-text, "http://www.cisecurity.org/xccdf/platform/0.2.3":platform-definitions, "http://checklists.nist.gov/xccdf-p/1.1":Platform-Specification, "http://cpe.mitre.org/XMLSchema/cpe/1.0":cpe-list, "http://cpe.mitre.org/language/2.0":platform-specification, "http://checklists.nist.gov/xccdf/1.1":platform, "http://checklists.nist.gov/xccdf/1.1":version}' is expected.
INFO : APPLICATION - Finished SCAP content validation in 00:00:29.156.
INFO : See results in scap-validation-result.xml.
	  

The first error indicates that the fdcc-ie7-xccdf.xml file failed schema validation against the XCCDF schema. Specifically the error is saying that the at element "platforms" in the XCCDF document the validator was expecting one of the other elements listed. scapval then combines all of the component SCAP files into an SCAP data stream. The schema validation for that combine SCAP data stream also fails on the XCCDF content, as indicated.

Top of page